package fr.pascal;

import net.webservicex.GeoIP;
import net.webservicex.GeoIPService;
import net.webservicex.GeoIPServiceSoap;

public class IPLocationFinder {
	public static void main(String[] args) {
		String ip1 = "173.194.40.175";
		go(ip1);
		ip1 = "78.109.91.101";
		go(ip1);
	}
	
	private static void go(String ipAddress) {
		GeoIPService service = new GeoIPService();
		GeoIPServiceSoap serviceSoap = service.getGeoIPServiceSoap();
		GeoIP geoIP = serviceSoap.getGeoIP(ipAddress);
		System.out.println("countryCode :: "+geoIP.getCountryCode());
		System.out.println("countryName :: "+geoIP.getCountryName());
		System.out.println("ip :: "+geoIP.getIP());
		System.out.println("returnCode :: "+geoIP.getReturnCode());
		System.out.println("returnCodeDetails :: "+geoIP.getReturnCodeDetails());
		System.out.println();
	}
}
